package com.huiyou.adminapi.repository;

import com.huiyou.adminapi.common.model.Goods;

import com.huiyou.adminapi.common.model.Product;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface GoodsRepository extends JpaRepository<Goods, String> {
    Page<Goods> findByNameContainingOrderByProductionTimeDesc(String name, Pageable pageable);

    List<Goods> findByProId(String proId);

    List<Goods> findByName(String name);

    List<Goods> findByNameAndIdIsNot(String name, String id);
}
